JavaScript

A5.u.elementsetContent Method

Syntax

A5.u.element.setContent(element,html)

Arguments

elementelementstring

A pointer to a DOM element or the ID of an element.

htmlstringelement

The HTML content to place in the element. Can be an HTML string, or a element.

Description

Sets the content of an element. Similar to calling .innerHTML on a DOM element with additional handling to preserve touch behaviors.

Discussion

Using A5.u.element.setContent() is like setting the .innerHTML of ele. Unlike .innerHTML, A5.u.element.setContent() will not destroy drag scrolling behavior on objects such as Panel Cards.

Example

// assume "id" is the ID of a panel body
// if .innerHTML was used to set the content drag scrolling would be broken
A5.u.element.setContent(id,'Working...');